package com.ceair.flight.refund.location.dt.enums;

/**
 *
 * @author wanghaipeng 统一支付响应码
 *
 */
public enum PayResponseCodeEnum {

    SUCCESS("000000", "支付成功，出票"),
    FAILURE("111111", "支付失败"),
    FAILURE_PROMOTIONS("000063", "该银行卡不支持该活动"),
    UNKNOWN("222222", "支付结果未知，等待后续通知"),
    FORWARD("555555", "使用Resv3进行页面直接跳转"),
    RISK_WAITING("666666", "支付成功，风控人工审核。出票并挂起，邮件通知（为避免投诉）"),
    RISK_SUCCESS("666777", "支付成功，人工审核接受，解挂，邮件通知（为避免投诉）"),
    RISK_FAILURE("666888", "支付成功，人工审核拒绝，解挂并退票、退款， 邮件通知（为避免投诉）"),
    RISK_FAILURE_NO_REFUND_PAY("666999", "支付成功，但用户拒绝支付，解挂并退票但不退款，邮件通知（为避免投诉）"),
    RISK_SUSPEND("777666", "人工单独挂起，触发人工挂起邮件"),
    RISK_UNSUSPEND("777777", "人工单独解挂，触发人工解挂邮件"),
    RISK_APPEAL("666222","支付成功，风控人工审核。待旅客申诉。邮件通知旅客上传证件图片"),
    RISK_ONSITEINSPECTION("666555","支付成功，风控现场验卡。邮件通知旅客");

    private final String code;
    private final String description;

    private PayResponseCodeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static PayResponseCodeEnum getByCode(String code) {
        for (PayResponseCodeEnum responseCodeEnum : values()) {
            if (responseCodeEnum.getCode().equals(code)) {
                return responseCodeEnum;
            }
        }
        return null;
    }

}
